package com.qding.park.manager.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.qding.park.common.core.annotation.log.OperationLogType;
import com.qding.park.common.core.annotation.log.SystemControllerLog;
import com.qding.park.common.core.validate.RchlValidateBean;
import com.qding.park.common.core.validate.RchlValidateTools;
import com.qding.park.common.web.controller.BaseController;
import com.qding.park.manager.common.pojo.ParkDataResult;
import com.qding.park.manager.common.rest.domain.AnswerMsg;
import com.qding.park.manager.common.rest.domain.AnswerMsgFactoryImpl;
import com.qding.park.manager.facade.statis.service.OrderInfoStatisFacade;

@RestController
@RequestMapping("/order")
public class Web_OrderController  extends BaseController{
    private static final Logger _log = LoggerFactory.getLogger(Web_OrderController.class);
	
	@Autowired
	private OrderInfoStatisFacade orderInfoStatisFacade;
	
	@SystemControllerLog(description="订单详情查询",operation=OperationLogType.order_info)
	@RequestMapping("info")
	public AnswerMsg list( String orderId) {
			
			/****** 验证字段 ********/
			RchlValidateBean vb = new RchlValidateBean();
			vb.getRequiredValidate().put("orderId", orderId);
			RchlValidateTools.validate(vb);
			/**************/
			
			/*组装统计条件*/
			
			
			/*组装统计条件*/
			
			/*****统计查询*******/
			ParkDataResult dataResult = orderInfoStatisFacade.orderInfo(orderId);
			AnswerMsg answerMsg = AnswerMsgFactoryImpl.createAnswerMsg(dataResult.getData());
			return answerMsg;
	}
	
}
